package user;

import book.Booklist;
import operation.*;

import java.util.Scanner;

public class Administrator extends User{

    Canoperation[] canoperations = new Canoperation[]{
            new Exit(),new Find(),new Show(),new Add()
    };
    public Administrator(String name) {
        super.name = name;
    }
    @Override
    public int menu() {
        Scanner sc = new Scanner(System.in);
        System.out.println("****************************");
        System.out.println("1.查询书籍");
        System.out.println("2.显示书籍");
        System.out.println("3.添加书籍");
        System.out.println("0.退出系统");
        System.out.println("****************************");
        System.out.print("请选择：");
        int choice = sc.nextInt();
        return choice;
    }

    @Override
    public void choices(int choice,Booklist booklist) {
        canoperations[choice].work(booklist);
    }
}
